$(document).ready(function () {
    Omplus.base.create(Omplus.application.Application, {
        omplusName:"aplication",
        body:{
            omplusName:"body",
            layout:{
                omplusType:"VerticalLayout",
                width:"1024px"
            }
        },
        loader:{
            omplusName:"loaderPanel",
            height:"200px",
            components:[
                {
                    omplusType:"ProgressBar",
                    omplusName:"loaderProgress"
                }
            ],
            layout:{
                omplusType:"VerticalLayout",
                width:"300px"
            },
            showEffect:{
            	name:"fade",
                time:500
            },
            hideEffect:{
                name:"fade",
                time:500
            },
            onCloseFinish:function () {
                if (Omplus.globals.getObject("User").getStatus() == Omplus.constants.status_error) {
                    Omplus.globals.getObject("loginPanel").show();
                } else {
                    Omplus.globals.getObject("pagePanel").show();
                    Omplus.globals.getObject("statusPanel").show();
                }
            }
        },
        languages:{
            omplusName:"Localization",
            action:"get"
        },
        users:{
            omplusName:"User",
            action:"isLoggedIn"
        },
        step:function (value) {
            Omplus.globals.getObject("loaderProgress").setValue(value);
        }
    }).run();
});